package rtp.servlets;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import rtp.model.Tarefa;
import rtp.model.TarefaManager;

/**
 * Servlet implementation class ListarTarefasServelet
 */

public class ListarTarefasServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String s = request.getParameter("status");

		List<Tarefa> result = 	TarefaManager.recuperarTarefaPorStatus( s );

		request.setAttribute("tarefas", result);

		RequestDispatcher view = request.getRequestDispatcher("result.jsp");
		
		view.forward(request, response);
	}


	
	

}
